//
//  DownloadInfo.m
//  ZYYD
//
//  Created by yuzhou on 12-8-2.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import "DownloadInfo.h"

@implementation DownloadInfo
@synthesize infoDic,downloaded,lastPercent,new,recordPage;

- (NSString *)description
{
    return [NSString stringWithFormat:@"pdf:%@ recordPage:%d",[infoDic valueForKey:@"item_id"],recordPage];
}

- (void)encodeWithCoder:(NSCoder *)aCoder
{
    [aCoder encodeObject:infoDic forKey:@"infoDic"];
    [aCoder encodeBool:downloaded forKey:@"downloaded"];
    [aCoder encodeFloat:lastPercent forKey:@"lastPercent"];
    [aCoder encodeBool:new forKey:@"new"];
    [aCoder encodeInt:recordPage forKey:@"recordPage"];
}

- (id)initWithCoder:(NSCoder *)aDecoder
{
    self.infoDic = [aDecoder decodeObjectForKey:@"infoDic"];
    self.downloaded = [aDecoder decodeBoolForKey:@"downloaded"];
    self.lastPercent = [aDecoder decodeFloatForKey:@"lastPercent"];
    self.new = [aDecoder decodeBoolForKey:@"new"];
    self.recordPage = [aDecoder decodeIntForKey:@"recordPage"];
    return self;
}

-(void)dealloc
{
    [infoDic release];
    [super dealloc];
}
@end
